home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / screenview / vms / crudetype.ch < prev    next >
Text File  |  1994-04-24  |  13KB  |  288 lines

  1. % Andrew Trevorrow, June 1988
  2. % All my changes (both here and in .WEB file) are flagged with "AKT".
  3. % AKT: Text file Change file for Crudetype.
  4.  
  5. @x
  6. *** Attach printer change file here ***
  7. @y
  8. \vskip 0.5in
  9. \centerline{The text file change file for Crudetype starts here}
  10. \vskip 0.5in
  11.  
  12. @<Const...@>= device_ID = 'Text file';
  13.  
  14. @ Where will the printed file go to?
  15.  
  16. @<Set init...@>=
  17.   set_string( print_end,
  18.   '.TXT                                                                 ' , ' ', 32 ) ;
  19.   {AKT: was .PRI}
  20.  
  21. @ The first lot of data describes the printer's overall style of carriage
  22. control. |fortran| means that the carriage control character gets put at the
  23. start of the line, and it is here assumed that it must be inserted explicitly.
  24. Note also that the program makes no attempt to check all these values for
  25. consistency.
  26.  
  27. @<Carriage control constants@>=
  28.   fortran = false ;
  29.   list = true ;                 {AKT: was false}
  30.   w_l_does_c_r = true ;         {AKT: was false}
  31.   b_feed_absolute = false ;
  32.   b_feed_by_string = false ;
  33.   feed_absolute = false ;
  34.   b_feed_scream = true ;
  35.   b_space_absolute = false ;
  36.   b_space_by_string = false ;
  37.   space_absolute = false ;
  38.   abs_is_incr = false ;
  39.   want_split = true ;
  40.   is_header = false ; {each page needs a header}
  41.   param_type = 'D' ;
  42.  
  43. @ This batch is concerned with distances and resolutions.
  44.  
  45. @<Const...@>=
  46.   l_margin =  0 ;             {AKT: was 6}
  47.   top_margin = 0 ;            {AKT: was 6}
  48.   h_resolution = 10 ;         {|h_steps| per inch}
  49.   v_resolution = 6 ;          {|v_steps| per inch}
  50.   fixed_width = true ;        {printers characters are fixed width}
  51.   char_width = 1 ;
  52.   {all printer characters are this width, in units of |h_step|. Normally,
  53.     |space_dist| will be equal to this, but some printers are not normal!}
  54.   gap_width = 1 ; {Intended minimum space between words}
  55.   char_ht = 1 ;
  56.  
  57. @ The general run of \TeX\ characters are narrower than line-printer chars. So
  58. we spread them out to make them fit.
  59.  
  60. @<Set init...@>=
  61.   h_fudge := 7.227  {number of points per |h_step|}
  62.   / 5.25 ;          {A typical design width}
  63.   v_fudge := 1.2 ;  {AKT: was 2.0 to force double-spacing }
  64.  
  65. @ @<Glob...@>=
  66.   h_fudge, v_fudge: real_num ;
  67.  
  68. @ Next, some constants for rule-setting.
  69.  
  70. @<Rule setting const...@>=
  71.   rail_width = 1 ;  {Height and width of rule chars, in steps}
  72.   rail_height  = 1 ;
  73.   post_width = 1 ;
  74.   post_height = 1 ;
  75.   rail_types = 2 ;
  76.  
  77. @ @<Set rule characters@>=
  78.   rail_chars[1] := codes[ 1, 95 ] ;
  79.   rail_chars[2] := codes[ 1, 45 ] ;
  80.   post_char := codes[ 1, 124] ;
  81.  
  82. @ @<Pause constants...@>=
  83.   do_pause = false ;
  84.   pause_steps = 20 ;
  85.   pause_ask = 'PAUSED. Type <return> to continue' ;
  86.  
  87. @ The next batch are concerned with fonts.
  88.  
  89. @<Const...@>=
  90.   min_font = 1 ;
  91.   {smallest and largest number of printers resident fonts}
  92.   max_font = 1 ;
  93.   only_one_font = true ;
  94.   can_dl_font = false ;
  95.   min_dl_font = 0 ;
  96.   max_dl_font = 0 ; {printers down-loadable fonts}
  97.   max_codes = 9 ;   {AKT: was 8; no. of known \TeX\ coding schemes}
  98.   max_char = 255 ;  {AKT: was 127; max. no. of chars per \TeX\ or PS font}
  99.   max_plain = 4 ;   {Max number of a plain text font}
  100.  
  101. @ Finally, consider command strings. These are intended to set options, but a
  102. line printer hasnt any.
  103.  
  104. @<Set init...@>=
  105.   start_stuff := blank ;
  106.   stop_stuff := blank ;
  107.   page_top  := blank ;
  108.   pause_after := blank ;
  109.  
  110. @* Character code data for the printer.
  111.  
  112. Here we actually put data into the |codes| array. In general, I have merely
  113. replaced each character in the PLAIN.TEX coding schemes by the nearest
  114. equivalent in ASCII, when a reasonable one exists ; I have not tried to tackle
  115. either AMSY or AMATHEX ; clearly there will be some scope for doing so. First
  116. we give the scheme names, ( padded to |code_len|) then do stuff for each
  117. scheme in turn.
  118.  
  119. @<Assign char...@>=
  120.   set_string( known_schemes[ 0 ] ,
  121.     '                                                                     ' , ' ', 32 ) ;
  122.   set_string( known_schemes[ 1 ] ,
  123.     'TEX EXTENDED ASCII                                                   ' , ' ', 32 ) ;
  124.   set_string( known_schemes[ 2 ] ,
  125.     'TEX TYPEWRITER TEXT                                                  ' , ' ', 32 ) ;
  126.   set_string( known_schemes[ 3 ] ,
  127.     'TEX TEXT                                                             ' , ' ', 32 ) ;
  128.   set_string( known_schemes[ 4 ] ,
  129.     'TEX TEXT WITHOUT F-LIGATURES                                         ' , ' ', 32 ) ;
  130.   set_string( known_schemes[ 5 ] ,
  131.     'AEFMNOT ONLY                                                         ' , ' ', 32 ) ;
  132.   set_string( known_schemes[ 6 ] ,
  133.     'TEX MATH ITALIC                                                      ' , ' ', 32 ) ;
  134.   set_string( known_schemes[ 7 ] ,
  135.     'TEX MATH SYMBOLS                                                     ' , ' ', 32 ) ;
  136.   set_string( known_schemes[ 8 ] ,
  137.     'TEX MATH EXTENSION                                                   ' , ' ', 32 ) ;
  138.   set_string( known_schemes[ 9 ] ,
  139.     'AKT: This scheme will be used for all unknown schemes; what a hack!  ' , ' ', 32 ) ;
  140.  
  141. @ Now do scheme 1 = EXTENDED ASCII
  142.  
  143. @<Assign char...@>=
  144.   alphabet( 32, 95, 1, 1, 32) ;
  145.   row(  ' .       {|v}    Z       Z       &       ~       {LC-}   Z           ' ,1,0,1) ;
  146.   row(  ' Z       Z       Z       {^|}    {+_}    {LO+}   Z       Z           ' ,1,1,1) ;
  147.   row(  ' Z       Z       Z       Z       Z       Z       {LOx}   Z           ' ,1,2,1) ;
  148.   row(  ' [{L<-}-] [-{-L>}] {=/}  Z       {L<_}   {L>_}   {=_}    [or]        ' ,1,3,1) ;
  149.  
  150. @ Now do scheme 2 = TYPEWRITER. Unfortunately, \.{TANGLE} imposes a limit of 69
  151. on the length of quoted strings. This causes difficulty because several multi-
  152. character commands are too long for 8 of them to fit neatly into a string of
  153. that length. So I use the Z command to ( effectively) split any complicated
  154. |row_spec| into two.
  155.  
  156. @<Assign char...@>=
  157.   alphabet( 32, 95, 2, 1, 32) ;
  158.   codes[2, 255].IM_char:= 34 ;        {AKT: was 2, 127}
  159.   row(  ' Z               [{/_}{_\}]      {0-}            [/\]        Z Z Z Z ' ,2,0,1) ;
  160.   {first half row}
  161.   row(  ' Z Z Z Z         <U_{-_}>        <U[__][||]>     <U_{L>_}>        LY ' ,2,0,1) ;
  162.   {and second}
  163.   row(  ' {oI}    {u|}    Z       {^|}    {v|}    Q       !       ?           ' ,2,1,1) ;
  164.   row(  ' i       j       `       Q       Z       Z       <U_>    <U.>        ' ,2,2,1) ;
  165.   row(  ' ,       {LB_}   [ae]    [oe]    {o/}    [LALE]  [LOLE]  {LO/}       ' ,2,3,1) ;
  166.  
  167. @ The TEX TEXT scheme is nearly the same, so we start by copying it.
  168.  
  169. @<Assign char...@>=
  170.   for in_i := 0 to 255 do codes [3, in_i] := codes [2, in_i] ;
  171.   {AKT: was   0 to 127}
  172.   row(  ' Z       Z       Z       [ff]    [fi]    [fl]    [ffi]   [ffl]       ' ,3,1,1) ;
  173.   row(  ' Z       Z       Z       Z       !       Z       ?       Z           ' ,3,7,1) ;
  174.   row(  ' Z       Z       Z       Z       W       Z       Z       <U.>        ' ,3,11,1) ;
  175.   row(  ' Z       Z       Z       -       [--]    W       ~       W           ' ,3,15,1) ;
  176.  
  177. @ Recently there has appeared a scheme, called TEX TEXT WITHOUT F-LIGATURES.
  178.  
  179. @<Assign char...@>=
  180.   for in_i := 0 to 255 do codes [4, in_i] := codes [3, in_i] ;
  181.   {AKT: was   0 to 127}
  182.   row(  ' {oI}    {u|}    Z       {^|}    {v|}    Q       !       ?           ' ,4,1,1) ;
  183.  
  184. @ and AEFMNOT ONLY  (for the Metafont logo).
  185.  
  186. @<Assign char...@>=
  187.   row(  ' Z      LA       Z       Z       Z      LE      LF       Z           ' ,5,8,1) ;
  188.   row(  ' Z       Z       Z       Z       Z      LM      LN      LO           ' ,5,9,1) ;
  189.   row(  ' Z       Z       Z       Z      LT       Z       Z       Z           ' ,5,10,1) ;
  190.  
  191. @ The MATH ITALIC scheme is almost impossible.
  192.  
  193. @<Assign char...@>=
  194.   for in_i := 0 to 9 do codes [6, in_i] := codes [2, in_i] ;
  195.   alphabet( 48, 43, 6, 1, 48) ;
  196.   alphabet( 97, 26, 6, 1, 97) ;
  197.   row(  ' Z       Z       .       ,       Z       /       Z       *           ' ,6,7,1) ;
  198.  
  199. @ MATH SYMBOLS are messy, and no doubt the results will look unpleasant.
  200.  
  201. @<Assign char...@>=
  202.   alphabet( 65, 26, 7, 1, 65) ;
  203.   row(  ' -       .       {\/}    *       {-:}    Z       {+_}    <U_+>       ' ,7,0,1) ;
  204.   row(  ' {LO+}   {LO-}   {LOx}   {LO/}   LO      LO       o       o          ' ,7,1,1) ;
  205.   row(  ' Z       {=_}    Z       Z       {L<_}   {L>_}   {L<_}   {L>_}       ' ,7,2,1) ;
  206.   row(  ' ~       <U~~>   Z       Z       [L<L<]  [L>L>]  L<      L>          ' ,7,3,1) ;
  207.   row(  ' [{L<-}-]        [-{L>-}]        {|^}            {|v}    Z Z Z Z     ' ,7,4,1) ;
  208.   row(  ' Z Z Z Z         [{L<-}{-L>}]    /               \       {~_}        ' ,7,4,1) ;
  209.   row(  ' [{L<=}=]        [={L>=}]        {|^}            {|v}    Z Z Z Z     ' ,7,5,1) ;
  210.   row(  ' Z Z Z Z         [{L<=}{=L>}]    Z               Z       Z           ' ,7,5,1) ;
  211.   row(  ' Q               [oo]            {L(-}           {-L)}   Z Z Z Z     ' ,7,6,1) ;
  212.   row(  ' Z Z Z Z         [{/_}{_\}]      <U[__][\/]>     /       Q           ' ,7,6,1) ;
  213.   row(  ' [{\-}{-/}]      <U_[{-_}|]>     ~       {0/}    LR LT   <U_|>   {|_}' ,7,7,1) ;
  214.   row(  ' Z       Z       Z       LU      Z       {LU+}   &       [or]        ' ,7,11,1) ;
  215.   row(  ' [{|-}-]         [-{-|}]         Z Z Z   Z       L{      L}          ' ,7,12,1) ;
  216.   row(  ' L<      L>      |       [||]    {^|v}   {^|v}   \       Z           ' ,7,13,1) ;
  217.   row(  ' <U[S_]{v/}>     [{LI_}{LI_}]    <[__][\/]>      </|/>   Z Z Z Z     ' ,7,14,1) ;
  218.  
  219. @ And here is a first attempt at the MATH EXTENSION scheme. These codes look
  220. rather peculiar because characters in the Extension font (unlike all others)
  221. have their reference points at the top. Here the restriction of string length
  222. to 69 is a real pain. It seemed that the least bad way to arrange these |row|s
  223. was by splitting each into 2 halves; then most half-rows do fit into one
  224. rowstring. Here are the left hand halves.
  225.  
  226. @<Assign char...@>=
  227.   row(' <SL(L(>         <SL)L)>         <SL[L[>         <SL]L]>         ZZZZ',8,0,1);
  228.   row(' <SL{L{>         <SL}L}>         <S/\>           <S\/>           ZZZZ',8,1,1);
  229.   row(' <SL(L(L(>       <SL)L)L)>       <SL(L(L(L(>     <SL)L)L)L)>     ZZZZ',8,2,1);
  230.   row(' <SL[|||>        <SL]|||>        <SL{/\L{>       <SL}\/L}>       ZZZZ',8,3,1);
  231.   row(' <SL(L(L(L(L(>   <SL)L)L)L)L)>   <SL[|||L[>      <SL]|||L]>      ZZZZ',8,4,1);
  232.   row(' <SL{L|L<|L{>    <SL}|L>|L}>     <S[S/]/\[S\]>   <S\[S\][S/]/>   ZZZZ',8,5,1);
  233.   row(' <S/||>          <S\||>          <SL[||>         <SL]||>         ZZZZ',8,6,1);
  234.   row(' <S[S/]|>        <S\[S|]>        <S|[S\]>        <S[S|]/>        ZZZZ',8,7,1);
  235.   row(' <S||\>          <S||/>          <S|>            <S|>            ZZZZ',8,8,1);
  236.   row(' <[__]\[{/_}_]>  <[__][LILI]>    </|/>           <S[||][\/]>     ZZZZ',8,10,1);
  237.   row(' <S[{|_}{|_}]>   <S[|S|][{|_}_{_|}]>     <U_>    <U[__]>         ZZZZ',8,12,1);
  238.   row(' <SL[L[L[>       <SL]L]L]>       <S||L[>         <S||L]>         ZZZZ',8,13,1);
  239.   row(' <S{|^}>         <S{|v}>         /               \               ZZZZ',8,15,1);
  240.  
  241. @ Here are the right hand halves.
  242.  
  243. @<Assign char...@>=
  244.   row('ZZZZ   <S|L[>          <S|L]>          <SL[|>          <SL]|>        ',8,0,1);
  245.   row('ZZZZ   <S|>            <S[||]>         <S[S/]/>        <Z\[S\]>      ',8,1,1);
  246.   row('ZZZZ   <SL[L[L[L[>     <SL]L]L]L]>     <S|||L[>        <S|||L]>      ',8,2,1);
  247.   row('ZZZZ   <S[S/]/\[S\]>   <S\[S\][S/]/>   <S[S/][S/]//>   <S\\[S\][S\]> ',8,3,1);
  248.   row('ZZZZ   <S||||L[>       <S||||L]>       <SL[||||>       <SL]||||>     ',8,4,1);
  249.   row('ZZZZ   <S[S/][S/]//>   <S\\[S\][S\]>   <S[SS/][S/]/>   <S\[S\][SS\]> ',8,5,1);
  250.   row('ZZZZ   <S||L[>         <S||L]>         <S|>            <S|>          ',8,6,1);
  251.   row('ZZZZ   <S[S|]L<[S|]>   <S|[SL>]|>      <S|>            <S|>          ',8,7,1);
  252.   row('ZZZZ   <S[S/]L<[S\]>  <S\[SL>]/>  <S[{|_}{|_}]>  <S[|S|][{|_}S{|_}]> ',8,8,1);
  253.   row('ZZZZ   <S[/\][||]>     <S[|+|][\_/]>   <S[/\]>         <S[\/]>       ',8,10,1);
  254.   row('ZZZZ   <U[___]>        <U~>            <U[~~]>         <U[~~~]>      ',8,12,1);
  255.   row('ZZZZ   <SL[||>         <SL]||>         <SL{L{L{>       <SL}L}L}>     ',8,13,1);
  256.   row('ZZZZ   \               /               <S{|^}>         <S{|v}>       ',8,15,1);
  257.  
  258. @ And here are the half rows that are so long that even half a row must be
  259. further split.
  260.  
  261. @<Assign char...@>=
  262.   row('        </{|O}/>   <S/{|O}|/>   <S[/\][\/]>   <S[S_][/.\][\_/]>  ZZZZ',8,9,1);
  263.   row('ZZZZ    <S[{/_}{\_}][\/]>       <S[S_][{/_}{|_}{_\}][\{|_}/]>      ZZ',8,9,1);
  264.   row('ZZZZZZ  <S[{\/}{/\}][{\/}{/\}]> <[S_][{\/}S{/\}][|{\/}|][{/\}_{/\}]> ',8,9,1);
  265.  
  266. @#
  267.   row('        <[___]\[SL>][{/_}__]>   <[___][|S|][|S|][|S|]> <S/||/>  ZZZZZ',8,11,1);
  268.   row('ZZZ     <S[|S|][|S|][\_/]>      <[S_][/S\][|S|][|S|]>             ZZZ',8,11,1);
  269.   row('ZZZZZ   <S[|S|][|+|][\_/]>      <SS[S/\][/SS\]>  <SS[\SS/][S\/]>     ',8,11,1);
  270.  
  271. @#
  272.   row('  <S[_S|][S\|]>   <S[SS|][_S|][S\|]>  <S[SS|][SS|][_S|][S\|]>   ZZZZZ',8,14,1);
  273.   row('ZZZ     <S[SS|][SS|][SS|][_S|][S\|]>  <S[SS|][_S|][S\|]>          ZZZ',8,14,1);
  274.   row('ZZZZZ   <S|>      <U_|>               <S[||]>                        ',8,14,1);
  275.  
  276. @ AKT: Now do scheme 9 = unknown (eg. PostScript font).
  277. We simply use the TEX TEXT scheme.
  278.  
  279. @<Assign char...@>=
  280.   for in_i := 0 to 255 do codes [9, in_i] := codes [3, in_i] ;
  281.  
  282. @ This must be done last of all:
  283.  
  284. @<Assign char...@>=
  285.   @<Set rule characters@>
  286.  
  287. @z
  288.